﻿@model IEnumerable<GdHotel.Data.RoomType>

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}

<p>
    @Html.ActionLink("Комнаты", "Index", "ManageRooms")
</p>

<h2>Категории комнат</h2>

<p>
    @Html.ActionLink("Создать", "Create")
</p>
@if (Model.Count() > 0)
{
    var first = Model.FirstOrDefault();
<table>
    <tr>
        <th>
            @Html.LabelFor(model => first.Title)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model)
{
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Title)
        </td>
        <td>
            @Html.ActionLink("Редактировать", "Edit", new { id=item.Id }) |
            @Html.ActionLink("Просмотр", "Details", new { id=item.Id }) |
            @Html.ActionLink("Удалить", "Delete", new { id=item.Id })
        </td>
    </tr>
}

</table>
}